********************************************************************************
* Figure 1: The Decline in Interest Rates around FOMC Meetings
********************************************************************************

use "../data/final_data_fed_secular_decline.dta", clear

keep if date >= mdy(6,1,1989)
drop if date >= mdy(7,1,2021)

local x "sveny10_chg"

*Construct yield change only around FOMC meetings
sort date
generate FOMC_change  = `x'  if  !missing(fomc_meet[_n+1]) | !missing(fomc_meet) | !missing(fomc_meet[_n-1])
generate nonFOMC_change  = `x'  if missing(fomc_meet[_n+1]) & missing(fomc_meet) & missing(fomc_meet[_n-1])

*Generate cumulative yield changes
gen cum_`x'			= sum(`x')
gen cum_FOMC_change = sum(FOMC_change)
gen cum_nonFOMC_change 	= sum(nonFOMC_change)

*********************************
* (A) 3-day window around FOMC meetings
*********************************

line cum_`x' cum_FOMC_change date, ///
scheme(s1mono) lcolor(gs6 red) ///
xlabel(, format(%tdCCYY)) ///
ylabel(, angle(horizontal)) ///
ytitle("Cumulative yield change (%)") ///
xtitle("") ///
legend(cols(1) pos(2) ring(0) symxsize(*0.5) ///
label(1 "10y Treasury yield") label(2 "10y Treasury yield change around FOMC meetings") )
graph export "../figures/figure1a.png", replace	

*********************************
* (B) Days outside of 3-day FOMC window
*********************************

line cum_`x'	 cum_nonFOMC_change date, ///
scheme(s1mono) ///
xlabel(, format(%tdCCYY)) ///
ylabel(, angle(horizontal)) ///
ytitle("Cumulative yield change (%)") ///
xtitle("") ///
legend(cols(1) pos(7) ring(0)  symxsize(*0.5) label(1 "10y Treasury yield") label(2 "10y Treasury yield change outside of FOMC window") )	
graph export "../figures/figure1b.png", replace
